From 40fd7a7490ff6337493873a433e40922f8f6597d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 May 2016 04:07:54 +0300 Subject: [PATCH] one more regexp --- tests/test_cargo_compile.rs | 2 +- tests/test_cargo_compile_git_deps.rs | 28 ++++++++++++------------- tests/test_cargo_compile_path_deps.rs | 30 +++++++++++++-------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index dc3877be5..2e318790b 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -315,7 +315,7 @@ test!(cargo_compile_with_warnings_in_a_dep_package { assert_that(p.cargo_process("build"), execs() - .with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + .with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url())) diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index f1ed636cf..052598a1f 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -56,7 +56,7 @@ test!(cargo_compile_simple_git_dep { assert_that(project.cargo_process("build"), execs() - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", path2url(git_root.clone()), @@ -123,7 +123,7 @@ test!(cargo_compile_git_dep_branch { assert_that(project.cargo_process("build"), execs() - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}?branch=branchy#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", path2url(git_root.clone()), @@ -193,7 +193,7 @@ test!(cargo_compile_git_dep_tag { assert_that(project.cargo_process("build"), execs() - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [COMPILING] dep1 v0.5.0 ({}?tag=v0.1.0#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", path2url(git_root.clone()), @@ -496,7 +496,7 @@ test!(recompilation { // First time around we should compile both foo and bar assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[UPDATING] git repository `{}`\n\ + execs().with_stderr(&format!("[UPDATING] git repository `{}`\n\ [COMPILING] bar v0.5.0 ({}#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", git_project.url(), @@ -516,7 +516,7 @@ test!(recompilation { execs().with_stdout("")); assert_that(p.cargo("update"), - execs().with_stdout(&format!("[UPDATING] git repository `{}`", + execs().with_stderr(&format!("[UPDATING] git repository `{}`", git_project.url()))); assert_that(p.cargo("build"), @@ -535,13 +535,13 @@ test!(recompilation { // Update the dependency and carry on! assert_that(p.cargo("update"), - execs().with_stdout(&format!("[UPDATING] git repository `{}`\n\ + execs().with_stderr(&format!("[UPDATING] git repository `{}`\n\ [UPDATING] bar v0.5.0 ([..]) -> #[..]\n\ ", git_project.url()))); println!("going for the last compile"); assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}#[..])\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", git_project.url(), p.url()))); @@ -551,7 +551,7 @@ test!(recompilation { .arg("-p").arg("foo"), execs().with_stdout("")); assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] foo v0.5.0 ({})\n", + execs().with_stderr(&format!("[COMPILING] foo v0.5.0 ({})\n", p.url()))); }); @@ -663,7 +663,7 @@ To learn more, run the command again with --verbose. assert_that(p.cargo("update") .arg("-p").arg("dep1") .arg("--aggressive"), - execs().with_stdout(&format!("[UPDATING] git repository `{}`\n\ + execs().with_stderr(&format!("[UPDATING] git repository `{}`\n\ [UPDATING] bar v0.5.0 ([..]) -> #[..]\n\ ", git_project.url()))); @@ -679,7 +679,7 @@ To learn more, run the command again with --verbose. // We should be able to update transitive deps assert_that(p.cargo("update").arg("-p").arg("bar"), - execs().with_stdout(&format!("[UPDATING] git repository `{}`", + execs().with_stderr(&format!("[UPDATING] git repository `{}`", git_project.url()))); }); @@ -764,7 +764,7 @@ test!(two_deps_only_update_one { assert_that(project.cargo_process("build"), execs() - .with_stdout(&format!("[UPDATING] git repository `[..]`\n\ + .with_stderr(&format!("[UPDATING] git repository `[..]`\n\ [UPDATING] git repository `[..]`\n\ [COMPILING] [..] v0.5.0 ([..])\n\ [COMPILING] [..] v0.5.0 ([..])\n\ @@ -782,7 +782,7 @@ test!(two_deps_only_update_one { assert_that(project.cargo("update") .arg("-p").arg("dep1"), execs() - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [UPDATING] dep1 v0.5.0 ([..]) -> #[..]\n\ ", git1.url())) .with_stderr("")); @@ -937,7 +937,7 @@ test!(dep_with_changed_submodule { assert_that(project.cargo("update").arg("-v"), execs() .with_stderr("") - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [UPDATING] dep1 v0.5.0 ([..]) -> #[..]\n\ ", git_project.url()))); @@ -1270,7 +1270,7 @@ test!(warnings_in_git_dep { assert_that(p.cargo_process("build"), execs() - .with_stdout(&format!("[UPDATING] git repository `{}`\n\ + .with_stderr(&format!("[UPDATING] git repository `{}`\n\ [COMPILING] bar v0.5.0 ({}#[..])\n\ [COMPILING] foo v0.5.0 ({})\n", bar.url(), diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 4eb560feb..0ed5e15ba 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -71,7 +71,7 @@ test!(cargo_compile_with_nested_deps_shorthand { assert_that(p.cargo_process("build"), execs().with_status(0) - .with_stdout(&format!("[COMPILING] baz v0.5.0 ({}/bar/baz)\n\ + .with_stderr(&format!("[COMPILING] baz v0.5.0 ({}/bar/baz)\n\ [COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), @@ -89,13 +89,13 @@ test!(cargo_compile_with_nested_deps_shorthand { println!("building baz"); assert_that(p.cargo("build").arg("-p").arg("baz"), execs().with_status(0) - .with_stdout(&format!("[COMPILING] baz v0.5.0 ({}/bar/baz)\n", + .with_stderr(&format!("[COMPILING] baz v0.5.0 ({}/bar/baz)\n", p.url()))); println!("building foo"); assert_that(p.cargo("build") .arg("-p").arg("foo"), execs().with_status(0) - .with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + .with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -228,7 +228,7 @@ test!(cargo_compile_with_transitive_dev_deps { "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -270,7 +270,7 @@ test!(no_rebuild_dependency { "#); // First time around we should compile both foo and bar assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -281,7 +281,7 @@ test!(no_rebuild_dependency { p.build(); // rebuild the files (rewriting them in the process) assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -336,7 +336,7 @@ test!(deep_dependencies_trigger_rebuild { pub fn baz() {} "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ + execs().with_stderr(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ [COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), @@ -354,7 +354,7 @@ test!(deep_dependencies_trigger_rebuild { pub fn baz() { println!("hello!"); } "#).unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ + execs().with_stderr(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ [COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), @@ -368,7 +368,7 @@ test!(deep_dependencies_trigger_rebuild { pub fn bar() { println!("hello!"); baz::baz(); } "#).unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -425,7 +425,7 @@ test!(no_rebuild_two_deps { pub fn baz() {} "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ + execs().with_stderr(&format!("[COMPILING] baz v0.5.0 ({}/baz)\n\ [COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), @@ -472,7 +472,7 @@ test!(nested_deps_recompile { let bar = p.url(); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/src/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/src/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", bar, p.url()))); @@ -484,7 +484,7 @@ test!(nested_deps_recompile { // This shouldn't recompile `bar` assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] foo v0.5.0 ({})\n", + execs().with_stderr(&format!("[COMPILING] foo v0.5.0 ({})\n", p.url()))); }); @@ -679,7 +679,7 @@ test!(path_dep_build_cmd { p.root().join("bar").move_into_the_past().unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -696,7 +696,7 @@ test!(path_dep_build_cmd { } assert_that(p.cargo("build"), - execs().with_stdout(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ + execs().with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\ [COMPILING] foo v0.5.0 ({})\n", p.url(), p.url()))); @@ -736,7 +736,7 @@ test!(dev_deps_no_rebuild_lib { assert_that(p.cargo("build") .env("FOO", "bar"), execs().with_status(0) - .with_stdout(&format!("[COMPILING] foo v0.5.0 ({})\n", + .with_stderr(&format!("[COMPILING] foo v0.5.0 ({})\n", p.url()))); assert_that(p.cargo("test"), -- 2.30.2